/*
 * Created on 2007-8-26
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.tongji.quickCRUDQ.html;

import com.tongji.quickCRUDQ.define.Column;

/**
 * @author Administrator
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class Anchor implements Control {

	private Object dynamic;
	/* (non-Javadoc)
	 * @see com.tongji.quickCRUDQ.html.Control#setDynamic(java.lang.Object)
	 */
	public void setDynamic(Object dynamic) {
		this.dynamic=dynamic;

	}
	/* (non-Javadoc)
	 * @see com.tongji.quickCRUDQ.html.Control#formatHtml(java.lang.String, boolean)
	 */
	public String formatTableHtml(String value, Column column) {
		StringBuffer html=new StringBuffer();
		html.append("<a name=\"").append(column.getColumnname()).append("\" value=\"")
		    .append(value).append("\" href=# onclick='doHref(this)'>").append(value)
			.append("</a>");
		return html.toString();

	}

	/* (non-Javadoc)
	 * @see com.tongji.quickCRUDQ.html.Control#formatDetailHtml(java.lang.String)
	 */
	public String formatDetailHtml(String value, Column column) {
		StringBuffer html=new StringBuffer();
		html.append("<input type='text' id=change name=\"").append(column.getColumnname())
		    .append("\" value=\"").append(value).append("\" maxlength=\"")
			.append(column.getLength()).append("\" title=\"").append(column.getAbbr())
			.append("\" class='INPUT_text' bnull=\"").append(column.getBnull())
			.append("\" ondblclick=doDblClick(this) onclick=doClick(this)");
		if(column.getBupdate().equals("N")) html.append(" disabled ");
        html.append(">");
		return html.toString();
	}
	/* (non-Javadoc)
	 * @see com.tongji.quickCRUDQ.html.Control#setStyleClass(java.lang.String)
	 */
	public void setStyleClass(String value) {
		// TODO Auto-generated method stub

	}
}
